🛡️ Sentinel: Fix sensitive data leakage in error responses#40
🛡️ Sentinel: Fix sensitive data leakage in error responses#40AGI-Corporation wants to merge 1 commit intomainfrom
Conversation
Remove sensitive credentials (JWT tokens and license keys) from ActivepiecesError parameters to prevent them from being leaked to clients via the global error handler. Co-authored-by: AGI-Corporation <186229839+AGI-Corporation@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request addresses a security vulnerability where JWT tokens and license keys were being exposed in error parameters serialized and sent to clients. The fix removes sensitive data from error instantiations and updates type definitions to prevent future inclusion of sensitive information in error params. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR mitigates a sensitive-data exposure issue by ensuring credential-like values (JWT tokens, license keys) are no longer included in ActivepiecesError.params, which the server error handler serializes back to clients.
Changes:
- Updated shared error param typings for
INVALID_OR_EXPIRED_JWT_TOKENandINVALID_LICENSE_KEYto disallow passing sensitive fields. - Removed token/key values from the corresponding
ActivepiecesErrorthrow sites in the server API. - Added a Sentinel learning note documenting the root cause and prevention approach.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/shared/src/lib/common/activepieces-error.ts | Tightens error param types for JWT/license key errors to prevent carrying sensitive values. |
| packages/server/api/src/app/ee/license-keys/license-keys-controller.ts | Stops including licenseKey in INVALID_LICENSE_KEY error params. |
| packages/server/api/src/app/ee/connection-keys/connection-key.service.ts | Stops including JWT token values in INVALID_OR_EXPIRED_JWT_TOKEN error params. |
| .jules/sentinel.md | Documents the incident and the preventative pattern for future changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR addresses a security vulnerability where sensitive information, specifically JWT tokens and license keys, was being included in error responses sent to the client.
🚨 Severity: MEDIUM
💡 Vulnerability: Exposure of Sensitive Data in Error Messages
🎯 Impact:
Invalid or expired JWT tokens and license keys were included in the
paramsfield ofActivepiecesErrorobjects. These objects are serialized and sent to the client by the global error handler in the backend. While the tokens/keys might be invalid or expired, leaking them still provides unnecessary information to potential attackers and can lead to sensitive data being recorded in client-side logs or intercepted.🔧 Fix:
packages/shared/src/lib/common/activepieces-error.tsto change the parameter types forINVALID_OR_EXPIRED_JWT_TOKENandINVALID_LICENSE_KEYtoRecord<string, never>.packages/server/api/src/app/ee/connection-keys/connection-key.service.tsandpackages/server/api/src/app/ee/license-keys/license-keys-controller.tsto stop passing the sensitive data to the error constructor.✅ Verification:
nx linton the affected packages to ensure type safety..jules/sentinel.md.PR created automatically by Jules for task 8744681762830886235 started by @AGI-Corporation
Summary by CodeRabbit